import { _decorator, Component, ERaycast2DType, Graphics, Node, PhysicsSystem2D, Vec2, Vec3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('rayCheck')
export class rayCheck extends Component {
    @property distance :Vec3 = new Vec3();
    @property(Graphics) CheckLine:Graphics = null;
    update(deltaTime: number) {
        if(this.CheckLine != null)this.getLine();
        
    }
    getLine(){
        this.CheckLine.moveTo(0,0);
        if(this.distance.y!=0)
            this.CheckLine.lineTo(0,this.distance.y);
        if(this.distance.x!=0)
            this.CheckLine.lineTo(this.distance.x,0);
        this.CheckLine.stroke();
    }
}


